package com.qyc.controller;

import com.qyc.service.AnalysisService;
import com.qyc.utils.ResponseResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @className: AnalysisController
 * @Description: 首页大屏Controller层
 * @author: qinyc
 * @date: 2023/6/22 17:59
 * @version: v1.0
 */
@Api(tags = "大屏展示")
@RestController
@RequestMapping("/analysis")
public class AnalysisController {
    //注入analysisService层对象
    @Autowired
    private AnalysisService analysisService;
    
    /**
     * @Author qinyc
     * @Description  统计栏舍，栏圈，动物数量，冷库数量，员工数量信息
     * @version: v1.0
     * @Date 18:09 2023/6/22
     **/
    @ApiOperation("统计栏舍，栏圈，动物数量，冷库数量，员工数量信息")
    @GetMapping("/count")
    public ResponseResult count(){
        return analysisService.count();
    }
    
    /**
     * @Author qinyc
     * @Description  统计动物体重信息
     * @version: v1.0
     * @Date 0:27 2023/6/23
     **/
    @ApiOperation("统计动物体重信息")
    @GetMapping("/indexCount")
    public ResponseResult indexCount(){
        return analysisService.indexCount();
    }

    /**
     * @Author qinyc
     * @Description  统计动物病症数量
     * @version: v1.0
     * @Date 2:45 2023/6/23
     **/
    @ApiOperation("统计动物病症数量")
    @GetMapping("/countDisease")
    public ResponseResult countDisease(){
        return analysisService.countDisease();
    }
    
    /**
     * @Author qinyc
     * @Description  统计本年度12个月销售动物
     * @version: v1.0
     * @Date 10:58 2023/6/23
     **/
    @ApiOperation("统计本年度12个月销售动物")
    @GetMapping("/countSales")
    public ResponseResult countSales(){
        return analysisService.countSales();
    }
}
